<template>
    <a-menu v-model:openKeys="openKeys" theme="dark" mode="inline" @select="openMenu">
        <a-sub-menu title="树形结构" key="1">
            <a-menu-item key="/tree1">
                <i class="iconfont icon-zuzhijiagou" style="font-size: 18px;"></i>
                <span>选择全部子项</span>
            </a-menu-item>
        </a-sub-menu>
    </a-menu>
</template>

<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router';

const router = useRouter()

const openKeys = ref(['1'])

const openMenu = ({ key }) => {
    router.push(key)
}
</script>

<style lang="less" scoped>
.iconfont {
    margin-right: 8px;
}
</style>